import http from "../utils/request";

//获取验证码

export const getCaptcha = () => http.get("/users/getCaptcha?v=next");

//验证验证码 (captcha 参数)

export const verifyCaptcha = (captcha) =>
  http.get("/users/verifyCaptcha", {
    params: {
      captcha,
    },
  });

//获取手机验证码 (phoneNumber 参数)

export const getSmsCode = (phoneNumber) =>
  http.post("/sms/send", { phoneNumber });

//手机号登录 (code 参数)

export const smsLogin = (code) => http.post("/users/login?type=sms", { code });

//常规登录   (username,password  参数)

export const login = (username, password) =>
  http.post("/users/login", { username, password });

  //获取二维码
  export const getQrcode = sid =>http.get("/users/getQrcode",{params:{sid}})

  //微信登录
  export const wechatLogin  = wechatCode =>http.get("/users/wechatLogin",{params:{wechatCode}})

  //获取登录日志
  export const getLoginLoginApi = (page = 1, count = 15)=>http.get("/getloginlog",{
    params:{
      page,
      count
    }
  })

  //获取学员列表
  export const getStuListApi = (page = 1,count = 15,classes = "")=>http.get("/students/getstulist",{
    params:{
      page,
      count,
      class:classes
    }
  })